<?php
include_once("header.php");

$domain=$_GET[id];
if($domain == ''){
echo "Domain invalid";
include_once("footer.php");
die();
}

$query=mysql_query("SELECT * FROM users WHERE email like '%$domain'");
$nUsers=mysql_num_rows($query);
if($nUsers < 1){echo "<h3>No registered users</h3>";}
echo "<h3>Domain: $domain</h3>";
echo "<h4><a href='user_add.php?domain=$domain'>Add new user now</a></h4>";
while($users = mysql_fetch_array($query))
{
if ($cor = CCCCCC){ $cor = EEF0EE;}else{ $cor = CCCCCC;}
echo "<center>
	<div style='background: $cor; width: 500px; text-align: left; padding: 2px; margin: 2px;'>
		&nbsp;
		<a href='user_view.php?id=$users[0]' title='Show users and informations'><img src='images/users.png'></a>  &nbsp;
		<a href='user_change_password.php?id=$users[0]' title='Change user password'><img src='images/pass.png'></a>  &nbsp;
		<a href='user_delete.php?id=$users[0]' title='Delete domain'><img src='images/del.png'></a>  &nbsp;
		<span style='font-weight: bold'>$users[0]</span>
	</div>
	</center>";
}
?>
<br /><br />
<br /><br />
<?php include_once("footer.php");?>
